
	
	 		socket.on('connect', function () {
                console.log("connected!");
                //请求 设备个数 数据
                socket.emit('data_device_count');
                //地图
                socket.emit('select_data_map_point');
            });
            //首页 设备数量
            socket.on('data_device_count_select', function (data) {
                console.log("receive device count data " + data);
                $("#total").html(data.total);
                $("#warn").html(data.warn);
                $("#ok").html(data.ok);
            });
            
            socket.on('select_data_map_point_return', function (data) {
                var markerArr = [];
                 for(var i =0;i<data.length;i++){
                    markerArr[i] = {};
                    markerArr[i].title = data[i].title;
                    markerArr[i].content = data[i].content;
                    markerArr[i].point  = data[i].point;
                    markerArr[i].isOpen = data[i].isOpen;
                    if(data[i].warn != null){//报警：红色图标
                       markerArr[i].icon = {w:23,h:25,l:46,t:21,x:9,lb:12};                                
                    }
                    else{ //正常：蓝色图标
                       markerArr[i].icon = {w:23,h:25,l:23,t:21,x:9,lb:12};
                    }

                }
                console.log(markerArr);
                initMap(markerArr);//创建和初始化地图
            });
